import Vue from 'vue'
import store from './store/index'
import Taro from '@tarojs/taro'

import './app.less'

// Vue.config.productionTip = false

const App = new Vue({
  store,
  onLaunch(options) {
    store.dispatch('dict/init')
    store.dispatch('user/init')
  },
  onUnhandledRejection() {
    Taro.showToast({
      title: '11111',
      icon: 'none',
      duration: 2000
    })
  },
  onError() {
    Taro.showToast({
      title: '22222',
      icon: 'none',
      duration: 2000
    })
  },
  render(h) {
    // this.$slots.default 是将要会渲染的页面
    Taro.onError(e => {
      console.log('error 1111')
    })
    return h('block', this.$slots.default)
  }
})

export default App
